<?php

class MArticleClass extends baseModel {

	public function getLastAricles($inLimit = 5) {
		$lsResult = $this->SimpleQuery("SELECT * FROM dino_article WHERE Valid='Y' AND Status = 'PUBLISHED' ORDER BY CreatedAt DESC LIMIT ".$inLimit);
		return $lsResult;
	}

	public function CreateArticle($isPerex, $isContent, $isStatus) {
		$this->SimpleQuery("INSERT INTO dino_article (Perex, Content, Status, ValidFrom, ValidTo) VALUES ('".$isPerex."', '".$isContent."', '".$isStatus."', ".getTime().", '".getMaxTime()."')");
	}

	public function GetArticle($inIDArticle) {
		$lsResult = $this->SimpleQuery("SELECT * FROM dino_article WHERE IDArticle = ".$inIDArticle);
		return $lsResult[0];
	}


}

?>